<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "{{%creative}}".
 *
 * @property integer $id
 * @property string $name
 * @property integer $is_static
 * @property integer $is_custom
 * @property integer $advertiser_id
 * @property string $advertiser_name
 * @property integer $template_id
 * @property integer $form
 * @property integer $type
 * @property integer $ad_type
 * @property integer $subadtype
 * @property integer $category_id
 * @property integer $material_source
 * @property string $material_id
 * @property string $format_id
 * @property integer $width
 * @property integer $height
 * @property string $size_list
 * @property string $title
 * @property string $txt
 * @property string $custom_code
 * @property integer $duration
 * @property string $pic_url
 * @property integer $protocal
 * @property string $file_url
 * @property string $ext
 * @property string $size
 * @property string $tanx_advertiser_id
 * @property string $adomain_full
 * @property string $adomain_list
 * @property string $landing_page
 * @property string $show_monitor_url
 * @property string $click_monitor_url
 * @property string $visible_urls
 * @property integer $hero_app
 * @property integer $cpe_material_source
 * @property string $cpe_material_id
 * @property string $cpe_format_id
 * @property string $cpe_size_list
 * @property string $cpe_duration
 * @property string $cpe_file_url
 * @property string $cpe_ext
 * @property string $cpe_weight
 * @property string $cpe_landing_page
 * @property string $cpe_show_monitor_url
 * @property string $cpe_click_monitor_url
 * @property string $extra_property
 * @property integer $status
 * @property integer $dynamic_flag
 * @property integer $creator
 * @property string $creator_name
 * @property string $last_update
 */
class Creative extends \app\models\BaseAR
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%creative}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['is_static', 'is_custom', 'advertiser_id', 'template_id', 'form', 'type', 'ad_type', 'subadtype', 'category_id', 'material_source', 'width', 'height', 'duration', 'protocal', 'hero_app', 'cpe_material_source', 'status', 'dynamic_flag', 'creator'], 'integer'],
            [['advertiser_id', 'format_id'], 'required'],
            [['size_list', 'custom_code', 'file_url', 'visible_urls', 'cpe_file_url'], 'string'],
            [['last_update'], 'safe'],
            [['name', 'advertiser_name', 'title'], 'string', 'max' => 128],
            [['material_id', 'ext', 'size', 'tanx_advertiser_id', 'cpe_material_id', 'cpe_size_list', 'cpe_ext', 'cpe_weight', 'creator_name'], 'string', 'max' => 64],
            [['format_id', 'cpe_format_id', 'cpe_duration'], 'string', 'max' => 32],
            [['txt', 'pic_url', 'adomain_full', 'adomain_list', 'landing_page', 'cpe_landing_page'], 'string', 'max' => 1024],
            [['show_monitor_url', 'click_monitor_url'], 'string', 'max' => 4096],
            [['cpe_show_monitor_url', 'cpe_click_monitor_url'], 'string', 'max' => 2048],
            [['extra_property'], 'string', 'max' => 255],
            [['advertiser_id', 'name'], 'unique', 'targetAttribute' => ['advertiser_id', 'name'], 'message' => 'The combination of Name and Advertiser ID has already been taken.']
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => 'Name',
            'is_static' => 'Is Static',
            'is_custom' => 'Is Custom',
            'advertiser_id' => 'Advertiser ID',
            'advertiser_name' => 'Advertiser Name',
            'template_id' => 'Template ID',
            'form' => 'Form',
            'type' => 'Type',
            'ad_type' => 'Ad Type',
            'subadtype' => 'Subadtype',
            'category_id' => 'Category ID',
            'material_source' => 'Material Source',
            'material_id' => 'Material ID',
            'format_id' => 'Format ID',
            'width' => 'Width',
            'height' => 'Height',
            'size_list' => 'Size List',
            'title' => 'Title',
            'txt' => 'Txt',
            'custom_code' => 'Custom Code',
            'duration' => 'Duration',
            'pic_url' => 'Pic Url',
            'protocal' => 'Protocal',
            'file_url' => 'File Url',
            'ext' => 'Ext',
            'size' => 'Size',
            'tanx_advertiser_id' => 'Tanx Advertiser ID',
            'adomain_full' => 'Adomain Full',
            'adomain_list' => 'Adomain List',
            'landing_page' => 'Landing Page',
            'show_monitor_url' => 'Show Monitor Url',
            'click_monitor_url' => 'Click Monitor Url',
            'visible_urls' => 'Visible Urls',
            'hero_app' => 'Hero App',
            'cpe_material_source' => 'Cpe Material Source',
            'cpe_material_id' => 'Cpe Material ID',
            'cpe_format_id' => 'Cpe Format ID',
            'cpe_size_list' => 'Cpe Size List',
            'cpe_duration' => 'Cpe Duration',
            'cpe_file_url' => 'Cpe File Url',
            'cpe_ext' => 'Cpe Ext',
            'cpe_weight' => 'Cpe Weight',
            'cpe_landing_page' => 'Cpe Landing Page',
            'cpe_show_monitor_url' => 'Cpe Show Monitor Url',
            'cpe_click_monitor_url' => 'Cpe Click Monitor Url',
            'extra_property' => 'Extra Property',
            'status' => 'Status',
            'dynamic_flag' => 'Dynamic Flag',
            'creator' => 'Creator',
            'creator_name' => 'Creator Name',
            'last_update' => 'Last Update',
        ];
    }
}
